MACRO(CONTAINS result name dir)
    FILE(GLOB children RELATIVE ${dir} ${dir}/*)
    FOREACH(child ${children})
        IF("${child}" STREQUAL "${name}")
            SET(${result} YES)
        ENDIF()
    ENDFOREACH()

ENDMACRO()


MACRO(SUBDIRLIST result curdir)
    FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
    SET(dirlist "")
    FOREACH(child ${children})
        IF(IS_DIRECTORY ${curdir}/${child})
            SET(dirlist ${dirlist} ${child})
        ENDIF()
    ENDFOREACH()
    SET(${result} ${dirlist})
ENDMACRO()

